package com.panda.admin.login.enums;

import lombok.Getter;

/**
 * author: tcy
 * description:有无免邮特权枚举
 */
public enum MenuTypeEnum {

    DIRECT("direct",0,"目录"),
    MENU("menu",1,"菜单"),
    BUTTON("button",2,"按钮");

    /**
     * 编码
     */
    @Getter
    protected String code;

    /**
     * 值
     */
    @Getter
    protected Integer value;


    /**
     * 键
     */
    @Getter
    protected String key;

    MenuTypeEnum(String code, int value, String key) {
        this.code = code;
        this.value = value;
        this.key = key;
    }

    public static MenuTypeEnum getByValue(Integer value) {

        MenuTypeEnum baseEnum = null;

        for (MenuTypeEnum item : values()) {
            if (item.getValue().equals(value)) {
                baseEnum = item;
                continue;
            }
        }
        return baseEnum;
    }

}
